CROSS_COMPILE=/home/qingchen/ICT/IPC/TEE/optee_v8/toolchains/aarch64/bin/aarch64-none-linux-gnu-
TEEC_EXPORT=/home/qingchen/ICT/IPC/TEE/optee_v8/out-br/per-package/optee_client_ext/target/usr
CRYPTO_EXPORT=/home/qingchen/ICT/IPC/TEE/optee_v8/out-br/per-package/openssl/target/usr

CC      := $(CROSS_COMPILE)gcc
LD      := $(CROSS_COMPILE)ld
AR      := $(CROSS_COMPILE)ar
NM      := $(CROSS_COMPILE)nm
OBJCOPY := $(CROSS_COMPILE)objcopy
OBJDUMP := $(CROSS_COMPILE)objdump
READELF := $(CROSS_COMPILE)readelf

OBJS = src/ka.o src/sipc.o

CFLAGS += -Wall -I$(shell pwd)/include -I/home/qingchen/ICT/IPC/TEE/optee_v8/optee_examples/api_test/ta/include -I$(TEEC_EXPORT)/include -I$(CRYPTO_EXPORT)/include
#Add/link other required libraries here
# LDADD += -lteec -lcrypto -lssl -L$(TEEC_EXPORT)/lib -L$(CRYPTO_EXPORT)/lib

LIBA = ./lib/libka.a


.PHONY: all
all: $(LIBA)

$(LIBA): $(OBJS)
	$(AR) $(LDFLAGS) rcs $@ $< $(LDADD)

.PHONY: clean
clean:
	rm -f $(OBJS) $(LIBA)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@
